load("@rules_go//go:def.bzl", "go_library", "go_test")

go_library(
    name = "server",
    srcs = [
        "api_server.go",
        "commit_store.go",
        "compaction.go",
        "compaction_cache.go",
        "diff.go",
        "master.go",
        "master_trigger.go",
        "option.go",
        "paths.go",
        "pfsserver.pb.go",
        "pfsserver.pb.validate.go",
        "pfsserver.pb.zap.go",
        "server.go",
        "server_branch.go",
        "server_commit.go",
        "server_commit_set.go",
        "server_egress.go",
        "server_file.go",
        "server_fsck.go",
        "server_project.go",
        "server_repo.go",
        "source.go",
        "storage_bucket.go",
        "transaction_defer.go",
        "url.go",
        "val_server.go",
        "worker.go",
        "worker_url.go",
    ],
    importpath = "github.com/pachyderm/pachyderm/v2/src/server/pfs/server",
    visibility = ["//visibility:public"],
    deps = [
        "//src/auth",
        "//src/internal/ancestry",
        "//src/internal/backoff",
        "//src/internal/client",
        "//src/internal/collection",
        "//src/internal/consistenthashing",
        "//src/internal/cronutil",
        "//src/internal/dbutil",
        "//src/internal/dlock",
        "//src/internal/errors",
        "//src/internal/errutil",
        "//src/internal/grpcutil",
        "//src/internal/log",
        "//src/internal/middleware/auth",
        "//src/internal/miscutil",
        "//src/internal/obj",
        "//src/internal/pachconfig",
        "//src/internal/pacherr",
        "//src/internal/pachsql",
        "//src/internal/pctx",
        "//src/internal/pfsdb",
        "//src/internal/pfsfile",
        "//src/internal/pfsutil",
        "//src/internal/promutil",
        "//src/internal/protoutil",
        "//src/internal/randutil",
        "//src/internal/sdata",
        "//src/internal/storage",
        "//src/internal/storage/chunk",
        "//src/internal/storage/fileset",
        "//src/internal/storage/fileset/index",
        "//src/internal/storage/metrics",
        "//src/internal/storage/track",
        "//src/internal/stream",
        "//src/internal/task",
        "//src/internal/transactionenv",
        "//src/internal/transactionenv/txncontext",
        "//src/internal/uuid",
        "//src/pfs",
        "//src/pps",
        "//src/server/pfs",
        "//src/server/pps",
        "//src/server/worker/common",
        "//src/task",
        "@com_github_aws_aws_sdk_go//aws",
        "@com_github_aws_aws_sdk_go//aws/credentials",
        "@com_github_aws_aws_sdk_go//aws/session",
        "@com_github_docker_go_units//:go-units",
        "@com_github_jmoiron_sqlx//:sqlx",
        "@com_github_pachyderm_ohmyglob//:ohmyglob",
        "@dev_gocloud//blob",
        "@dev_gocloud//blob/azureblob",
        "@dev_gocloud//blob/fileblob",
        "@dev_gocloud//blob/gcsblob",
        "@dev_gocloud//blob/memblob",
        "@dev_gocloud//blob/s3blob",
        "@io_etcd_go_etcd_client_v3//:client",
        "@org_golang_google_grpc//codes",
        "@org_golang_google_grpc//status",
        "@org_golang_google_protobuf//proto",
        "@org_golang_google_protobuf//reflect/protoreflect",
        "@org_golang_google_protobuf//runtime/protoimpl",
        "@org_golang_google_protobuf//types/known/anypb",
        "@org_golang_google_protobuf//types/known/durationpb",
        "@org_golang_google_protobuf//types/known/emptypb",
        "@org_golang_google_protobuf//types/known/timestamppb",
        "@org_golang_google_protobuf//types/known/wrapperspb",
        "@org_golang_x_sync//errgroup",
        "@org_uber_go_zap//:zap",
        "@org_uber_go_zap//zapcore",
    ],
)

go_test(
    name = "server_test",
    srcs = [
        "storage_bucket_test.go",
        "url_test.go",
    ],
    data = ["//src/server/pfs/server/testing:testdata"],
    embed = [":server"],
    tags = [
        "external",
    ],
    deps = [
        "//src/internal/obj",
        "//src/internal/obj/integrationtests",
        "//src/internal/randutil",
        "//src/internal/require",
        "@dev_gocloud//blob",
    ],
)

filegroup(
    name = "protos",
    srcs = glob(["*.proto"]),
    visibility = ["//src:__pkg__"],
)
